package com.hsh.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hsh.entity.OperationLog;
import com.hsh.mapper.OperationLogMapper;
import com.hsh.service.IOperationLogService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 日志记录表 服务实现类
 * </p>
 *
 * @author 黄思海
 * @since 2021-06-26
 */
@Service
public class OperationLogServiceImpl extends ServiceImpl<OperationLogMapper, OperationLog> implements IOperationLogService {

    private final Logger logger = LoggerFactory.getLogger(this.getClass().getSimpleName());

    @Override
    public void saveLog(OperationLog log) {
        try {
            this.save(log);
        } catch (Exception e) {
            logger.error("错误织入日志, {} ", e.getMessage());
        }
    }
}
